/*
 * GCalThread is designed to handle the Google Calendar integration of the BeautyRoxy system
 * by calling GCalEngine.
 * 
 * GCalThread extends Thread for the purpose of multithreading. 
 *  
 */
// @author A0105514U
/** @author A0105514U */

package global;

import gCalEngine.GCalEngine;

public class GCalThread extends Thread{
	GCalEngine engine;
	
	public GCalThread(){
		engine = new GCalEngine();
		GlobalFields.IS_GOOGLE_CONNECTED = false;
		start();
	}
	
	public void run(){
		try{
			engine.synchronize();
			Thread.sleep(200);
			this.run();
		}catch(Exception e){
			e.printStackTrace();
			GlobalFields.IS_GOOGLE_CONNECTED = false;
			engine.stopService();
		}
	}
}